home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10884 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  940 b 

  1. Path: ix.netcom.com!news
  2. From: Amit Ramon <amitra@ix.netcom.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: help with bytes -> long
  5. Date: Sun, 10 Mar 1996 21:06:22 -0600
  6. Organization: Netcom
  7. Message-ID: <314398AE.923@ix.netcom.com>
  8. References: <4hl3mh$oue@frodo.smartlink.net>
  9. NNTP-Posting-Host: ix-stl4-25.ix.netcom.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-NETCOM-Date: Sun Mar 10  9:04:56 PM CST 1996
  14. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  15.  
  16. Thomas Hackbarth wrote:
  17. > I suck at bit manipulation. I need a macro to convert RGB to a long so I
  18. > get this output
  19. > RED GREEN BLUE  -> LONG
  20. > FF   00    FF       FF 00 FF 00
  21. > Using Windows RGB macro I get this
  22. > RED GREEN BLUE  -> COLORREF
  23. > FF   00    FF       00 FF 00 FF
  24. > Anyone have any good Ideas?
  25. > Thanks
  26. > Thomas
  27.  
  28. This piece of code should do it:
  29.  
  30. COLORREF clr = RGB (FF, 0, FF);
  31. long l = clr << 8;
  32.  
  33. Amit.
  34.